Skip to content

ci: raise coverage thresholds from 0% to meaningful levels#97

Open
zoeshawwang wants to merge 1 commit intomainfrom
feat/strict-ci-gates
Open

ci: raise coverage thresholds from 0% to meaningful levels#97
zoeshawwang wants to merge 1 commit intomainfrom
feat/strict-ci-gates

Conversation

@zoeshawwang
Copy link
Copy Markdown
Collaborator

加两道 CI 卡点,把 SDK 的回归保护从"形同虚设"提到"防得住典型回归"。

开发者改了 __xxx_async_template.py 但忘跑 make codegen,对应的 xxx.py 就和 template 脱节,下次别人跑 codegen 会被覆盖。CI 现在
make codegen && git diff --exit-code,发现 diff 直接 fail 并提示 本地补跑 make codegen 后提交。

零风险:当前 main 上 make codegen 输出零 diff,新 step 立即就能过。

coverage.yaml 之前 full / incremental 全设 0,等于不卡。
基于本地实测当前覆盖率(line 90.74% / branch 82.85%)设:

  • 全量阈值:line 85 / branch 78(留 ~5% buffer 防 CI 抖动误伤)
  • 增量阈值:line 85 / branch 75(推动新代码自带测试)
  • directory_overrides:
    • utils: 90/90(基础设施代码,保持高线)
    • knowledgebase: 95/90(历史高覆盖)
    • memory_collection: 80/50(历史短板,不严于现状,先不回退)
    • conversation_service: 65/60(历史短板,同上)

uv run --python 3.10 --all-extras python scripts/check_coverage.py 本地跑通 23 项检查全 ✅。

  • pyink/isort 格式 check:当前 19 个存量文件不合规(含 tests/e2e/test_workspace_id.py 等),需要先 reformat 再加 check。
  • ruff/pylint lint check
  • 多 Python 版本矩阵(目前只跑 3.10)
  • E2E on CI(需要 Secret 配 AccessKey)

Change-Id: I8bd1fb2f3262fe77143d606e5f0ebb9125cf0932
Co-developed-by: Claude noreply@anthropic.com

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

Set coverage gates based on current real metrics with ~5% buffer:
- Full: line 85%, branch 78%
- Incremental: line 85%, branch 75%
- Per-directory overrides for utils (90/90), knowledgebase (95/90),
  memory_collection (80/50), conversation_service (65/60)

Change-Id: I7bb247168d1907ca53b46989021b7cd77ed5b2f0
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
@zoeshawwang zoeshawwang force-pushed the feat/strict-ci-gates branch from ddc46d3 to cfe5829 Compare May 9, 2026 08:12
@zoeshawwang zoeshawwang changed the title ci: enforce codegen sync + raise coverage thresholds from 0% ci: raise coverage thresholds from 0% to meaningful levels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants